home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 311_01 / sortest.c < prev    next >
C/C++ Source or Header  |  1990-04-21  |  2KB  |  40 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      sortest.c  v1.3  (c) 1990  Ken Harris                               */
  5. /*                                                                          */
  6. /*                                                                          */
  7. /****************************************************************************/
  8. /*                                                                          */
  9. /*      This software is made available on an AS-IS basis. Unrestricted     */
  10. /*      use is granted provided that the copyright notice remains intact.   */
  11. /*      The author makes no warranties expressed or implied.                */
  12. /*                                                                          */
  13. /****************************************************************************/
  14.  
  15. #include <stdio.h>
  16.  
  17. main()
  18. {
  19.         char rec[10];
  20.         int i;
  21.  
  22.         printf("sortest - Test of Callable Record Sort\n\n");
  23.         printf("Sort-init...\n");
  24.         sort_init(6, "aa1.4");
  25.  
  26.         printf("Release 100 records...\n");
  27.         for (i=99; i>0; i--)
  28.         {       sprintf(rec, "%04d", i);
  29.                 printf("%d\n", i);
  30.                 sort_release(rec);
  31.         }
  32.  
  33.         printf("Sort-merge...\n");
  34.         sort_merge();
  35.  
  36.         printf("Return 100 records...\n");
  37.         while (sort_return(rec))
  38.                 printf("%4.4s\n",rec);
  39. }
  40.